﻿using System;
using OutdoorLib.BaseEntity.Dictionary;
using OutdoorLib.BaseEntity.Constraction;
using OutdoorLib.BaseEntity.WS;


public partial class TestTreeValues : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
    }

    protected TreeDictionaryItemValue Щит_15
    {
        get
        {            
            TreeDictionaryItem dic1 = AppEnvironment.DictionarySource.GetTreeDictionaryItem(TreeDictionaryItem.TreeDictionary_ConstractionType);
            TreeDictionaryItemValue v1 = dic1.BuildValue("_2");
            v1.AddValue("_5");
            v1.AddValue("_33");

            return v1;

        }
    }

    protected TreeDictionaryItemValue Щит_9_16
    {
        get
        {
            TreeDictionaryItem dic1 = AppEnvironment.DictionarySource.GetTreeDictionaryItemWithTypeID(TreeDictionaryItem.TreeDictionary_ConstractionType); 
            TreeDictionaryItemValue v1 = dic1.BuildValue("_2");            
            return v1;

        }
    }

    protected TreeDictionaryItemValue Регулируемый 
    {
        get
        {
            TreeDictionaryItem dic1 = AppEnvironment.DictionarySource.GetTreeDictionaryItemWithTypeID(TreeDictionaryItem.TreeDictionary_LocationDescribe);
            TreeDictionaryItemValue v1 = dic1.BuildValue("e42312fb-fb2d-420d-a74c-cef5047b9f89");
            return v1;
        }
    }


    protected TreeDictionaryItemValue НеРегулируемый
    {
        get
        {
            TreeDictionaryItem dic1 = AppEnvironment.DictionarySource.GetTreeDictionaryItemWithTypeID(TreeDictionaryItem.TreeDictionary_LocationDescribe);
            TreeDictionaryItemValue v1 = dic1.BuildValue("73153c44-db60-4d68-a46a-d2fe3768dcdd");
            return v1;
        }
    }


    protected TreeDictionaryItemValue Лавочка
    {
        get
        {
            TreeDictionaryItem dic1 = AppEnvironment.DictionarySource.GetTreeDictionaryItemWithTypeID(TreeDictionaryItem.TreeDictionary_ConstractionType);
            TreeDictionaryItemValue v1 = dic1.BuildValue("_5");
            return v1;
        }
    }

    
    protected void Button1_Click(object sender, EventArgs e)
    {
        //TextBox1.Text = Щит_9_16.ToString() +"          ";
        //TextBox1.Text = TextBox1.Text + Прямой + "          ";
        //TextBox1.Text = TextBox1.Text +Лавочка + "          ";
        bool swch=false ;
        for (int i = 0; i < 500; i++)
        {
            ConstractionEntity c = new ConstractionEntity();
            if (swch)
                c.ConstractionType = Щит_9_16;
            else
                c.ConstractionType = Лавочка;
            swch = !swch;
                        
            //c.IsAlcoholCondition = swch;
            c.Describe = "Конструкция описание" + i.ToString();
            c.dtCreate = DateTime.Now;
            //c.LocationDescribe = (swch ? Регулируемый :НеРегулируемый );
            c.MapX = 2457877;
            c.MapY = 24778;
            c.Number = "Номер" + i.ToString();
            // первая сторона 
            Side s1=new Side ();
            s1.Litera = "A";
            s1.SurfaceCount =1;
            s1.GRP = 25;
            s1.LookDistance = 250;

            // вторая сторона 
            Side s2 = new Side();
            s2.Litera = "B";
            s2.SurfaceCount = 1;
            s2.GRP = i;
            s2.LookDistance = i;

            c.SideList.Add(s1);
            c.SideList.Add(s2);

            wsConstractions.Save (c); 
        }
         

    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        //EmployeeListWhere where = new EmployeeListWhere();
        //ObjectWhere_EntityList List = new ObjectWhere_EntityList();
        //List.ListWhere = where;
        //List.Load();
    }
}
